<?php
use \tpfcore\Core;
?>
<!doctype html>
<head>
        <meta charset="utf-8">
        <!-- Set render engine for 360 browser -->
        <meta name="renderer" content="webkit">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <!-- HTML5 shim for IE8 support of HTML5 elements -->
        <!--[if lt IE 9]>
            <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js">
            </script>
        <![endif]-->
        <link href="{$admin_assets_path}/css/theme.min.css" rel="stylesheet">
        <link href="{$admin_assets_path}/css/simplebootadmin.css" rel="stylesheet">
        <link href="{$admin_assets_path}/css/default.css" rel="stylesheet" />
        <link href="{$admin_assets_path}/css/font-awesome.min.css" rel="stylesheet" type="text/css">
        <style>
            .length_3{width: 180px;} form .input-order{margin-bottom: 0px;padding:3px;width:40px;}
            .table-actions{margin-top: 5px; margin-bottom: 5px;padding:0px;} .table-list{margin-bottom:
            0px;}
        </style>
        <!--[if IE 7]>
            <link rel="stylesheet" href="{$admin_assets_path}/css/font-awesome-ie7.min.css">
        <![endif]-->
        <script type="text/javascript">
            //全局变量
            var GV = {
                WEB_ROOT:"",
                DIMAUB: "/",
                JS_ROOT: "/theme/backend/assets/js/",
                TOKEN: ""
            };
        </script>
        <!-- Le javascript==================================================-
        -> <!-- Placed at the end of the document so the pages load faster -->
        <script src="{$admin_assets_path}/js/jquery.js"></script>
        <script src="{$admin_assets_path}/js/wind.js"></script>
        <script src="{$admin_assets_path}/js/bootstrap.min.js"></script>
        <script src="{$admin_assets_path}/kindeditor/kindeditor-min.js"></script>
        <link href="{$admin_assets_path}/kindeditor/themes/default/default.css" rel="stylesheet"/>
    </head>
<body>
<script type="text/javascript">
$(function(){
    var config='{$list[0]->pay_config}';
    if(config.length>0){
        config=eval("("+config+")");
        for(key in config){
            $("#"+key).val(config[key]);
        }
    }
});
</script>
<div class="wrap">
    <ul class="nav nav-tabs">
        <li><a href="{:url('Payment/index')}">支付管理</a></li>
        <li class="active">
            <a href="{:url('Payment/config',['id'=>$list[0]->id,'handle'=>$handle])}">支付配置</a>
        </li>
    </ul>
    <form method="post" class="form-horizontal js-ajax-form" action="">
        <input type="hidden" name="id" value="{$list[0]->id}" />
        <fieldset>
            <div class="control-group">
                <label class="control-label">支付名称</label>
                <div class="controls">
                    <input type="text" value="{$list[0]->pay_name}" readonly="readonly">
                    <span class="form-required">*</span>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">支付说明</label>
                <div class="controls">
                    <input type="text" value="{$list[0]->pay_desc}" readonly="readonly">
                    <span class="form-required">*</span>
                </div>
            </div>
            {if condition="$handle eq 'alipay'"}
            <div class="control-group">
                <label class="control-label">appId</label>
                <div class="controls">
                    <input type="text" name="pay_config[appId]" id="appId" value="">
                    <span class="form-required">*</span>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">rsaPrivateKey</label>
                <div class="controls">
                    <textarea name="pay_config[rsaPrivateKey]" id="rsaPrivateKey" style="width: 750px; height: 200px;"></textarea>
                    <span class="form-required">*</span>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">alipayrsaPublicKey</label>
                <div class="controls">
                    <textarea name="pay_config[alipayrsaPublicKey]" id="alipayrsaPublicKey" style="width: 750px; height: 200px;"></textarea>
                    <span class="form-required">*</span>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">sign_type</label>
                <div class="controls">
                    <input type="text" name="pay_config[sign_type]" id="sign_type" value="RSA2">
                    <span class="form-required">*</span>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">charset</label>
                <div class="controls">
                    <input type="text" name="pay_config[charset]" id="charset" value="UTF-8">
                    <span class="form-required">*</span>
                </div>
            </div>
            {elseif condition="$handle eq 'weixin'" /}
            <div class="control-group">
                <label class="control-label">APPID</label>
                <div class="controls">
                    <input type="text" name="pay_config[APPID]" id="APPID" value="">
                    <span class="form-required">*</span>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">MCHID</label>
                <div class="controls">
                    <input type="text" name="pay_config[MCHID]" id="MCHID" value="">
                    <span class="form-required">*</span>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">KEY</label>
                <div class="controls">
                    <input type="text" name="pay_config[KEY]" id="KEY" value="" style="width: 300px;">
                    <span class="form-required">*</span>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">APPSECRET</label>
                <div class="controls">
                    <input type="text" name="pay_config[APPSECRET]" id="APPSECRET" value="" style="width: 300px;">
                    <span class="form-required">*</span>
                </div>
            </div>
            {else /}
            {/if}
        </fieldset>
        <div class="form-actions">
            <button type="submit" class="btn btn-primary js-ajax-submit">
                确定操作
            </button>
            <a class="btn" href="{:url('Payment/index')}">返回</a>
        </div>
    </form>
</div>
<script src="{$admin_assets_path}/js/common.js"></script>
</body>
</html>